sudo su root

# * Network
systemctl start wpa_supplicant
wpa_cli

> add_network
> set_network 0 ssid "myhomenetwork"
> set_network 0 psk "mypassword"
> set_network 0 key_mgmt WPA-PSK
> enable_network 0

# * Quit after seeing this: <3>CTRL-EVENT-CONNECTED - Connection to 32:85:ab:ef:24:5c completed [id=0 id_str=]
# * ping baidu.com


# * File System
lsblk
parted /dev/sda -- mklabel gpt
parted /dev/sda -- mkpart nixos btrfs 512MB -12G  # 主分区
parted /dev/sda -- mkpart swap linux-swap -12G 100%
parted /dev/sda -- mkpart ESP fat32 1MB 512MB
parted /dev/sda -- set 3 esp on

# parted /dev/sda # Instantly effective
# > mklabel gpt
# > mkpart nixos btrfs 1G -12G  # 主分区
# > mkpart swap linux-swap -12G 100%  # 交换分区
# > mkpart ESP fat32 1MB 512MB  # 引导分区
# > set 3 esp on  # 可启动标识
# quit

mkfs.btrfs -L os /dev/sda1
mkfs.fat -F 32 -n boot /dev/sda3
mkswap /dev/sda2
mount /dev/sda1 /mnt
mkdir -p /mnt/boot
mount /dev/sda3 /mnt/boot
swapon /dev/sda2
nixos-generate-config --root /mnt


nix-shell -p proxychains
echo "socks5 192.168.1.49 7890" >> conf
proxychains4 -f conf nix-shell -p git
git clone https://gitee.com/yanfsong/chezmoi
proxychains4 -f conf nixos-install --flake chezmoi/nix-config/flake.nix#thinkpad
########################################
nmcli device wifi connect SSID password PASSWORD


